<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="ss"%>

<jsp:include page="../header.jsp" />
<div id="content">
	<div id="topstory" class="box">
		<h1>
			<fmt:message key="publisher.title.show">
				<fmt:param value="${publisher.nazev }" />
			</fmt:message>
		</h1>
	</div>
	<div class="padding">
		<c:choose>
			<c:when test="${ publisher != null}">
				<table border="0" cellspacing="5" cellpadding="0" width="100%" class="formTable tplBorder">
					<tr>
						<td width="15%"></td>
						<td width="35%"></td>
						<td width="15%"></td>
						<td width="35%"></td>
					</tr>
					<tr>
						<td class="label"><fmt:message key="department.name" /></td>
						<td class="valueOutView"><c:out value="${publisher.nazev }" /></td>
						<td colspan="2" />
					</tr>
					<tr>
						<td class="label"><fmt:message key="user.street" /></td>
						<td class="valueOutView"><c:out value="${publisher.ulice}" /></td>
						<td colspan="2" />
					</tr>
					<tr>
						<td class="label"><fmt:message key="user.mesto" /></td>
						<td class="valueOutView"><c:out value="${publisher.mesto }" /></td>
						<td class="label"><fmt:message key="user.psc" /></td>
						<td class="valueOutView"><c:out value="${publisher.psc }" /></td>
					</tr>
				</table>
				<display:table export="true" id="data" name="bookList" requestURI="/publisher/show.do?publisherId=${publisher.id}"
					decorator="cz.boxdesign.library.web.decorator.BookTableDecorator">
					<ss:authorize access="hasRole('ROLE_ADMIN')">
						<display:column property="editUrl" titleKey="common.edit" sortable="false" />
					</ss:authorize>
					<display:column property="showUrl" titleKey="common.show" sortable="false" />
					<display:column property="nazev" titleKey="book.list.name" sortable="true" />
					<display:column property="nakladatelstviLink" titleKey="book.list.publisher" sortable="true" />
					<display:column property="pocetKnih" titleKey="book.list.book.count" sortable="true" />
					<display:column property="rokVydani" titleKey="book.list.year" sortable="true" />
				</display:table>

			</c:when>
			<c:otherwise>
				<div class="ui-widget">
					<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
						<p>
							<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> <strong>Alert:</strong>
							<c:out value="${error }" />
							. Please contact administrator.
						</p>
					</div>
				</div>

			</c:otherwise>
		</c:choose>
	</div>
	<!-- /padding -->
</div>
<!-- /content -->
<jsp:include page="side-menu.jsp" />
<jsp:include page="../foother.jsp" />
